home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / MATHS / ARCAUT / Automatons / BrianBrain < prev    next >
Text File  |  1991-07-27  |  1KB  |  41 lines

  1. AUTOMATON*
  2.  
  3.   Brian's_Brain
  4.  
  5.   The owner of the escaped brain in question, is one Brian Silverman. His
  6.   brain is a deceptively simple three state automaton, run in the Moore
  7.   neighbourhood. The three states are referred to as 'ready', 'firing' &
  8.   'refractory'. A cell which has just fired will become refractory on the
  9.   next generation & then revert to ready. Ready cells will subsequently fire
  10.   if they have precisely two firing neigbours. This results in pulses of
  11.   firing cells drifting across the brain, colliding & sending off signals in
  12.   other directions. An initial soup quickly settles down to a typical level
  13.   of activity. Try a window of 200x100.
  14.  
  15. INITIALISATION*
  16.  
  17.   10DEF PROCdo
  18.   20*SetEval wrap on
  19.   30*SetEval ready 127
  20.   40*SetEval firing 96
  21.   50*SetEval refractory 22
  22.   60ENDPROC
  23.  
  24. SCREEN*
  25.  
  26.   10DEF PROCdo
  27.   20DIM buf% 256:SYS "OS_ReadVarVal","ready",buf%,256:rea=!buf%
  28.   30SYS "OS_ReadVarVal","firing",buf%,256:fir=!buf%
  29.   40SYS "OS_ReadVarVal","refractory",buf%,256:ref=!buf%
  30.   50PROCsoup(ref,1,1)
  31.   60PROCsoup(rea,1,.5):PROCsoup(fir,1,.33)
  32.   70ENDPROC
  33.  
  34. CODE*
  35.  
  36. ( CELL <ready>  = IF (READ_NEIG <firing> SCOUNT_NEIG
  37.                       2 = IF (<firing> ==) <ready> ==)
  38.   CELL <firing> = IF (<refractory> ==)
  39.                       <ready>      ==                  )
  40.  
  41. END*